#pragma once

#include "Handles.h"
#include "Effect.h"

namespace Audio
{
	class SubEvent
	///////////////////////////////////////////////////////////////////////////////
	// Description: An event consists of a list of sub-events triggered at certain
	//				times.
	//
	// Recent Changes:
	// -brasmuss 4/3/2007 : Created
	///////////////////////////////////////////////////////////////////////////////
	{
	public:
		SubEvent(FileHandle& file) : m_file(file) {}
		bool Update(float delta, class CoreSystem* core);

		void			AddEffect(struct Effect* effect)         { m_effects.push_back(effect); }
		FileHandle		GetFileHandle()                          { return m_file; }
		void			SetChannelHandle(ChannelHandle& channel) { m_channel = channel; }
		ChannelHandle	GetChannelHandle()						 { return m_channel; }

	private:
		ChannelHandle	m_channel;
		FileHandle		m_file;
		effectlist_t	m_effects;
	};

	class Event
	///////////////////////////////////////////////////////////////////////////////
	// Description: A series of events and effects specified in the tool
	//
	// Recent Changes:
	// -brasmuss 3/29/2007 : Created
	///////////////////////////////////////////////////////////////////////////////
	{
	public:
		Event() :  m_time(0.0f) {}
		bool Update(float delta, class CoreSystem* core);
		void AddSubEvent(SubEvent* subEvent, float time);
		subeventlist_t& GetActiveSubEvents() { return m_activeSubEvents; }

	private:
		float			m_time;				//!< Accumulated time
		subeventlist_t	m_activeSubEvents;	//!< List of active WAVEs that are paired to graphs and variables and effects
		subeventqueue_t	m_queuedSubEvents;	//!< Inactive sub-events
	};
}